<%@ page import="java.util.List" %>
<%@ page import="database.*" %>
<%@ page import="utils.StringUtils" %><%--
  Created by IntelliJ IDEA.
  User: jimmyhsu
  Date: 2016/12/19
  Time: 8:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>评论</title>
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link href="../../static/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<%@include file="checkStudentLogin.jsp"%>
<div class="navbar">
    <div class="navbar-inner">
        <a class="brand" href="#" style="color: #1abc9c;">青马班</a>
        <ul class="nav">
            <li><a href="signIn.jsp">签到</a></li>
            <li><a href="selectCourse.jsp">课程</a></li>
            <li class="active"><a href="#">评价</a></li>
        </ul>
    </div>
</div>
<table class="table table-striped">
<%
    String studentId = (String) request.getSession().getAttribute("username");
    List<Course> finishedCourses = CourseDb.selectAllFinishedCourses(0, 999);
    if (finishedCourses.size() == 0) {%>
    <div class="alert">
        <strong>提示</strong> 还没有完成的课程哦。
    </div>
    <%
        }
    for (Course course : finishedCourses) {
        if (CourseDb.isUserInCourse(studentId, course.getId())) {
%>
<tr>
    <td><%=course.getName()%></td>
    <td><a href="commentCourse.jsp?courseId=<%=course.getId()%>&studentId=<%=studentId%>">
        <%=CommentDb.selectComment(studentId, course.getId())==null?"去评价":"修改评价"%></a> </td>
</tr>
    <%}}%>
</table>

<%@include file="footer.jsp"%>
<script src="../../static/js/jquery-1.10.2.js"></script>
</body>
</html>
